

import get from '@dfeidao/atom-web/local/get';
import set from '@dfeidao/atom-web/local/set';
import set_node_cls from '@dfeidao/atom-web/ui/set-node-cls';

import { IFeidaoAiBrowserComponent } from '@dfeidao/web/interfaces';
export default async function a003(fd: IFeidaoAiBrowserComponent, args: Event) {
	const nodea = args.currentTarget as HTMLDivElement;
	const node = nodea.closest('[vlist]') as HTMLDivElement;
	const nodes = fd.data.node.querySelectorAll<HTMLDivElement>('[vlist]');
	nodes.forEach((i) => {
		set_node_cls(i, 'bg-c', false);

	});
	set_node_cls(node, 'bg-c', true);
	const obj = JSON.parse(node.getAttribute('data-v'));
	// debugger;
	const fei = get(fd, 'fei') as string;
	set(fd, 'feild', obj[fei]);
	// console.log(obj[fei])
}
